package com.yulian.web.handler.impl;

import com.yulian.web.handler.ReportCommonHandler;
import com.yulian.web_api.common.ReportCommonManager;
import com.yulian.web_api.system_management.AuthorizationManager;

import io.netty.util.internal.logging.InternalLogger;
import io.netty.util.internal.logging.Log4JLoggerFactory;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.RoutingContext;
import io.vertx.pgclient.PgPool;

/**
 * 此类为接口CommonHandler的实现类，在该类的handle方法中，对多个页面共用的 web请求uri，调用业务逻辑类的相应方法进行处理
 *
 * @author 余大勇
 */
public class ReportCommonHandlerImpl implements ReportCommonHandler {

    //final InternalLogger logger = Log4JLoggerFactory.getInstance(SupplierInfoHandlerImpl.class);
    private final PgPool pool;
    private final JsonObject config;

    public ReportCommonHandlerImpl(PgPool pool, JsonObject config) {
        this.pool = pool;
        this.config = config;
    }

    @Override
    public void handle(RoutingContext req) {
        JsonObject bodyJSObj = req.body().asJsonObject();
        ReportCommonManager reportcommonManager = new ReportCommonManager();
        AuthorizationManager authorization = new AuthorizationManager();
        JsonObject responseJSObj = new JsonObject();
        switch (req.request().uri().toString()) {
            case "/web/reportcommon/get_auth":
                //获取当前用户在***页面所具有的按钮权限
                authorization.getAuth(pool, bodyJSObj, req.user())
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_aes_key":
                //获取当前用户在***页面所具有的按钮权限
                reportcommonManager.getAesKey(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/post_aes_endata":
                //获取当前用户在***页面所具有的按钮权限
                reportcommonManager.postEnData(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_goods_gather_area":
                reportcommonManager.getGoodsGatherArea(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_class_lv1":
                reportcommonManager.getClassLv1(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_class_lv1_of_class_lv2":
                reportcommonManager.getClassLv1OfClassLv2(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_class_lv2":
                reportcommonManager.getClassLv2(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_class_lv2_of_variety":
                reportcommonManager.getClassLv2OfVariety(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_variety":
                reportcommonManager.getVariety(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_variety_of_aggregation":
                reportcommonManager.getVarietyOfAggregation(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_aggregation":
                reportcommonManager.getAggregation(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_aggregation_of_supply_chain_goods":
                reportcommonManager.getAggregationOfSupplyChainGoods(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supply_chain_goods_from_goods_pool":
                reportcommonManager.getSupplyChainGoodsFromGoodsPool(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supply_chain_goods":
                reportcommonManager.getSupplyChainGoods(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supply_chain_goods_grade":
                reportcommonManager.getSupplyChainGoodsGrade(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_list_goods_from_goods_pool":
                reportcommonManager.getListGoodsFromGoodsPool(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_list_goods":
                reportcommonManager.getListGoods(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_list_goods_grade":
                reportcommonManager.getListGoodsGrade(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_sales_package_spec_type":
                reportcommonManager.getSalesPackageSpecType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_goods_price_mode":
                reportcommonManager.getGoodsPriceMode(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_goods_specification":
                reportcommonManager.getGoodsSpecification(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_sales_quantity_scheme":
                reportcommonManager.getSalesQuantityScheme(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier":
                reportcommonManager.getSupplier(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier_grade":
                reportcommonManager.getSupplierGrade(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supply_chain_partner":
                reportcommonManager.getSupplierChainPartner(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_gender":
                JsonArray jsonArray = config.getJsonArray("GENDER_INFO_LIST");
                responseJSObj.put("data", jsonArray);
                req.response().putHeader("content-type", "application/json").end(responseJSObj.toString());
                break;
            case "/web/reportcommon/get_age_group":
                reportcommonManager.getAgeGroup(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_operation_period":
                reportcommonManager.getOperationPeriod(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_account_type":
                reportcommonManager.getAccountType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_invoice_type":
                reportcommonManager.getInvoiceType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_invoice_cycle":
                reportcommonManager.getInvoiceCycle(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_goods_sales_grade":
                reportcommonManager.getGoodsSalesGrade(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_material_price_mode":
                reportcommonManager.getMaterialPriceMode(pool)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
//		case "/web/reportcommon/get_supplier_type":
//			reportcommonManager.getSupplierType(pool, config)
//			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
//			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
//			break;
            case "/web/reportcommon/get_role":
                reportcommonManager.getRole(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
//		case "/web/reportcommon/get_system_menu":
//			reportcommonManager.getSystemMenu(pool)
//			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
//			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
//			break;
//		case "/web/reportcommon/get_system_parent_menu":
//			reportcommonManager.getSystemParentMenu(pool)
//			.onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
//			.onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
//			break;
            case "/web/reportcommon/get_site":
                reportcommonManager.getSite(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_site_query":
                reportcommonManager.getSiteQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_big_area":
                reportcommonManager.getBigArea(pool, bodyJSObj)
                        .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                        .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            //开始处理查询筛选下拉框	
            case "/web/reportcommon/get_goods_gather_area_query":
                reportcommonManager.getGoodsGatherAreaQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_mainline_route":
                reportcommonManager.getMainlineRoute(pool)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_mainline_route_query":
                reportcommonManager.getMainlineRouteQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_class_lv1_query":
                reportcommonManager.getClassLv1Query(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_class_lv2_query":
                reportcommonManager.getClassLv2Query(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_variety_query":
                reportcommonManager.getVarietyQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_aggregation_query":
                reportcommonManager.getAggregationQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier_query":
                reportcommonManager.getSupplierQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_goods_sales_grade_query":
                reportcommonManager.getGoodsSalesGradeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier_type_query":
                reportcommonManager.getSupplierTypeQuery(pool, config, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_list_goods_status_query":
                reportcommonManager.getListGoodsStatusQuery(pool, config, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supply_chain_goods_status_query":
                reportcommonManager.getSupplyChainGoodsStatusQuery(pool, config, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_admit_query":
                reportcommonManager.getAdmitQuery(pool, config, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_delete_query":
                reportcommonManager.getDeleteQuery(pool, config, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_outer_package_type":
                reportcommonManager.getOuterPackageType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_outer_package_type_query":
                reportcommonManager.getOuterPackageTypeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_outer_package_mode":
                reportcommonManager.getOuterPackageMode(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_outer_package_mode_query":
                reportcommonManager.getOuterPackageModeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_inner_package_type":
                reportcommonManager.getInnerPackageType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_inner_package_type_query":
                reportcommonManager.getInnerPackageTypeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_package_charac_type":
                reportcommonManager.getPackageCharacType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_package_charac_type_query":
                reportcommonManager.getPackageCharacTypeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_truck_type":
                reportcommonManager.getTruckType(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_truck_type_by_driver_name":
                reportcommonManager.getTruckTypeByDriverName(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_plate_number_by_driver_name":
                reportcommonManager.getPlateNumberByDriverName(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;

            case "/web/reportcommon/get_residence_area":
                reportcommonManager.getResidenceArea(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_residence_area_query":
                reportcommonManager.getResidenceAreaQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_carrier_driver_query":
                reportcommonManager.getCarrierDriverQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_legal_entity_query":
                reportcommonManager.getLegalEntityQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_loss_type_query":
                reportcommonManager.getLossTypeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_batch_pickup_plan_load_completion_code_query":
                reportcommonManager.getBatchPickupPlanLoadCompletionCodeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier_pickup_goods_inspect_accept_code_query":
                reportcommonManager.getSupplierPickupGoodsInspectAcceptCodeQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_warehouse_query":
                reportcommonManager.getWarehouseQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier_info_query":
                reportcommonManager.getSupplierInfoQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_payment_entity_query":
                reportcommonManager.getPaymentEntityQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
            case "/web/reportcommon/get_supplier_invoice_query":
                reportcommonManager.getSupplierInvoiceQuery(pool, bodyJSObj)
                .onSuccess(resultJSObj -> req.response().putHeader("content-type", "application/json").end(resultJSObj.toString()))
                .onFailure(err -> req.response().putHeader("content-type", "application/json").end(responseJSObj.put("code", -1).put("msg", "错误: " + err.getMessage()).toString()));
                break;
        }

    }

}
